﻿using System;
using System.Data;

namespace msBsc.WebUi
{
    public partial class mfGoodsView : msBsc.Cls.mbPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindControls();
                ShowData(this.Request.QueryString.Get("ID"));
            }
        }

        private void BindControls()
        {
            if (!IsPostBack)
            {
            }
        }

        public string GetPriceHtml()
        {
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();
            bool blOld = false;
            if (decimal.Parse(drGoods["GOODS_OLD_PRICE"].ToString() == string.Empty ? "0.00" : drGoods["GOODS_OLD_PRICE"].ToString()) > 0)
            {
                blOld = true;
            }
            string strScorePrive = "";
            if (drGoods["MALL_NO"].ToString() == "1")
            {
                strScorePrive = @"
    <dl class=""tm-promo-panel tm-promo-cur"" id=""J_PromoScore"" data-label=""积分"">
        <dt class=""tb-metatit"">积分换购</dt><dd><div class=""tm-promo-price"">
             <span class=""tm-price"" id=""spnStrikeScore"" style=""font-size: 26px;"">" + drGoods["GOODS_STRIKE_SCORE"].ToString() + @"</span><em class=""tm-yen"">分</em>  &nbsp;&nbsp;
        </div>
            <p>
            </p>
        </dd>
    </dl>";
            }

            sbHtml.Append(@"
    <dl class=""tm-promo-panel tm-promo-cur"" id=""J_PromoPrice"" data-label=""价格"">
        <dt class=""tb-metatit"">价格</dt><dd><div class=""tm-promo-price"">
            <em class=""tm-yen"">￥</em> <span class=""tm-price"" id=""spnStrikePrice"">" + drGoods["GOODS_STRIKE_PRICE"].ToString() + @"</span> <span class=""tm-price-item"" id=""spnStrikePriceDesc"">" + drGoods["PRICE_DESC"].ToString() + @"</span>  &nbsp;&nbsp;
        </div>
            <p>
            </p>
        </dd>
    </dl>
    " + strScorePrive + @"
    <dl class=""tm-price-panel"" id=""J_StrPriceModBox"">
        <dt class=""tb-metatit"">原价</dt>
        <dd>
            <em class=""tm-yen"">￥</em> <span class=""tm-price"" id=""spnOldPrice"">" + drGoods["GOODS_OLD_PRICE"].ToString() + @"</span></dd>
    </dl> ");
            if (!blOld)
            {
                this.ExecJScript("$('#J_StrPriceModBox').hide();");
            }
             
            return sbHtml.ToString();
        }

        public string GetGoodsImgShow()
        {
            string[] arrstrimg = drGoods["IMG_URL_LIST"].ToString().Split(',');
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder(); 
            string strfirstImgUrl = "data:image/png;base64,";
            if (arrstrimg.Length > 0 && arrstrimg[0] != string.Empty)
            {
                strfirstImgUrl = arrstrimg[0];
            }
            sbHtml.Append(@"<div class=""gb-img-vew""><img id=""J_ImgBooth"" alt="""" src=""" + strfirstImgUrl + @" 450x450img.jpg"" /></div><div class=""gb-img-nav""><ul>");
            for (int i = 0; i < arrstrimg.Length; i++)
            {
                sbHtml.Append(@"<li class=""gb-selected-img""><img alt="""" src=""" + arrstrimg[i] + @" 450x450img.jpg"" /></li>"); 
            }
            sbHtml.Append(@"</ul></div>");

            return sbHtml.ToString();
        }

        private DataSet dsAttr = null;
        public string GetGoodsAttrList()
        {
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();
            if (dsAttr == null)
            {
                using (msBsc.AppLogic.DataAlc.CBizShpGoodsAttribute oCDbAccess = new msBsc.AppLogic.DataAlc.CBizShpGoodsAttribute())
                {
                    dsAttr = oCDbAccess.SelectByGoodsId(strGoodsId);
                }
            } 
            sbHtml.Append(@"
    <div class=""tm-clear tb-hidden tm_brandAttr"" id=""J_BrandAttr"" style=""display: block;"">
        <div class=""name"">
            品牌名称：<a class=""J_EbrandLogo"" target=""_blank"" href=""/c_GoodsSearch.htm?b=" + drGoods["BRAND_ID"].ToString() + @""">" + drGoods["BRAND_NME"].ToString() + (drGoods["BRAND_NME_EN"].ToString() != string.Empty ? "/" + drGoods["BRAND_NME_EN"].ToString() : "") + @"</a></div>
            </div>
    <p class=""attr-list-hd tm-clear"">
        <em>产品参数：</em></p>
    <ul id=""J_AttrUL"">");
            for (int i = 0; i < dsAttr.Tables[0].Rows.Count; i++)
            {
                sbHtml.Append(@"<li title=""&nbsp;" + dsAttr.Tables[0].Rows[i]["ATTRIBUTE_VALUE"].ToString() + @""">" + dsAttr.Tables[0].Rows[i]["ATTRIBUTE_NME"].ToString() + @":&nbsp;" + dsAttr.Tables[0].Rows[i]["ATTRIBUTE_VALUE"].ToString() + @"</li>");
            }
            sbHtml.Append(@" </ul>");

            return sbHtml.ToString();
        }
        public string GetGoodsDescHtml()
        {
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();
            sbHtml.Append(@"
<script type=""text/javascript"">  
    function setnviframe1Size() { 
    $('#nviframe1').width($($('#nviframe1')[0].contentWindow.document).width()); 
    $('#nviframe1').height($($('#nviframe1')[0].contentWindow.document).height()); 
    }; 
</script>
<iframe id=""nviframe1"" scrolling=""no""  frameborder=""0"" src=""" + drGoods["GOODS_DESC_URL"].ToString() + @""" style=""width:100%;"" onload=""setnviframe1Size();""></iframe>");
            sbHtml.Append(@" </ul>");

            return sbHtml.ToString();
        }


        private DataSet dsNorms = null;
        public string GetGoodsNormsList()
        {
            if (drGoods["NORMS_COUNT"].ToString() == "1" || drGoods["NORMS_COUNT"].ToString() == "0" || drGoods["NORMS_COUNT"].ToString() == string.Empty)
            {
                return "";
            }
            System.Text.StringBuilder sbHtml1 = new System.Text.StringBuilder();
            System.Text.StringBuilder sbHtml2 = new System.Text.StringBuilder();
            if (dsNorms == null)
            {
                using (msBsc.AppLogic.DataAlc.CBizShpGoodsNormsPublic oCDbAccess = new msBsc.AppLogic.DataAlc.CBizShpGoodsNormsPublic())
                {
                    dsNorms = oCDbAccess.SelectByGoodsId(strGoodsId);
                }
            }
            System.Collections.Generic.List<string> lsNorms1 = new System.Collections.Generic.List<string>();
            System.Collections.Generic.List<string> lsNorms2 = new System.Collections.Generic.List<string>();
            for (int i = 0; i < dsNorms.Tables[0].Rows.Count; i++)
            {
                if (!string.IsNullOrEmpty(dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString()) && !lsNorms1.Contains(dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString()))
                {
                    if (lsNorms1.Count == 0)
                    {
                        sbHtml1.Append(@"
    <dl class=""tb-prop tm-clear"">
    <dt class=""tb-metatit"">" + drGoods["NORMS_NME1"].ToString() + @"</dt>
    <dd>
        <ul data-property=""p1"" id=""J_TSaleProp_p1"" class=""tm-clear J_TSaleProp"" sel-data-value="""">");
                         
                        sbHtml1.Append(@"<li data-value=""" + dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() + @"""><a href=""javascript:void(0);"" ><span>" + dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() + @"</span></a></li>");
                    }
                    else
                    {
                        sbHtml1.Append(@"<li data-value=""" + dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() + @"""><a href=""javascript:void(0);"" ><span>" + dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() + @"</span></a></li>");
                    }
                    lsNorms1.Add(dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString());
                }

                if (!string.IsNullOrEmpty(dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString()) && !lsNorms2.Contains(dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString()))
                {
                    if (lsNorms2.Count == 0)
                    {
                        sbHtml2.Append(@"
    <dl class=""tb-prop tm-clear"">
    <dt class=""tb-metatit"">" + drGoods["NORMS_NME2"].ToString() + @"</dt>
    <dd>
        <ul data-property=""p2"" id=""J_TSaleProp_p2"" class=""tm-clear J_TSaleProp"" sel-data-value="""">");
                        sbHtml2.Append(@"<li data-value=""" + dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() + @"""><a href=""javascript:void(0);"" ><span>" + dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() + @"</span></a></li>");
                    }
                    else
                    {
                        sbHtml2.Append(@"<li data-value=""" + dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() + @"""><a href=""javascript:void(0);"" ><span>" + dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() + @"</span></a></li>");
                    }
                    lsNorms2.Add(dsNorms.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString());
                }

            }
            if (sbHtml1.Length > 0)
            {
                sbHtml1.Append(@"</ul></dd></dl>");
            }
            if (sbHtml2.Length > 0)
            {
                sbHtml2.Append(@"</ul></dd></dl>");
            }


            return sbHtml1.ToString() + sbHtml2.ToString();
        }

        public string strTotalQty = "0";
        public DataRow drGoods = null;
        private string strGoodsId = "";
        private void ShowData(string strId)
        {
            if (string.IsNullOrEmpty(strId))
            {
                this.ToErrPage("当前浏览的货物不存在，可能已下架！");
                return;
            }
            using (msBsc.AppLogic.DataAlc.CBizShpGoodsInfo oCDbAccess = new msBsc.AppLogic.DataAlc.CBizShpGoodsInfo())
            {
                System.Data.DataSet ds = oCDbAccess.SelectGoodsViewData(strId);
                if (ds.Tables[0].Rows.Count <= 0)
                {
                    this.ToErrPage("当前浏览的货物不存在，可能已下架！");
                    return;
                }
                else
                {
                    drGoods = ds.Tables[0].Rows[0];
                    if (drGoods["GOODS_STATUS_SID"].ToString() != "1")
                    {
                        this.ExecJScript("$('#divErrShow').show();");
                        this.ExecJScript("$('#divsubbtn').hide();");
                    }
                    else
                    {
                        this.ExecJScript("$('#divErrShow').hide();");
                        this.ExecJScript("$('#divsubbtn').show();");
                    }

                    using (msBsc.AppLogic.DataAlc.CBizShpCommercialTenantInfo oshop = new AppLogic.DataAlc.CBizShpCommercialTenantInfo())
                    {
                        string strmsg = oshop.ValitPubGoods(msBsc.SvRef.UserInfo.OperDealerId.Split(',')[0], drGoods["COMM_TENANT_SID"].ToString(), drGoods["DEPOSIT_AMT"].ToString());
                        if (strmsg != string.Empty)
                        {
                            this.ExecJScript("$('#divErrShow').show();");
                            this.ExecJScript("$('#divErrShow').html('" + strmsg + "');");
                            this.ExecJScript("$('#divsubbtn').hide();");
                        }
                    }

                    //if (drGoods["COMM_TENANT_SID"].ToString() == "4")
                    //{
                    //    this.ExecJScript("$('#divErrShow').show();");
                    //    this.ExecJScript("$('#divErrShow').html('该店铺已关闭，不能购买！');");
                    //    this.ExecJScript("$('#divsubbtn').hide();");
                    //} 

                    strGoodsId = strId;
                    this.ExecJScript("$('#txtId').val('" + strGoodsId + "');");
                    this.ExecJScript("$('#txtLogisId').val('" + ds.Tables[0].Rows[0]["LOGISTICS_TEMPLATE_ID"].ToString() + "');");
                    this.ExecJScript("$('#txtDealerId').val('" + ds.Tables[0].Rows[0]["COMM_TENANT_ID"].ToString() + "');");



                    this.ExecJScript("$('#spnRateCount1').html('" + ds.Tables[0].Rows[0]["EVALUATION_COUNT"].ToString() + "');");
                    this.ExecJScript("$('#spnMonthVol1').html('" + ds.Tables[0].Rows[0]["MONTHLY_VOLUME"].ToString() + "');");
                    this.ExecJScript("$('#spnRateCount2').html('" + ds.Tables[0].Rows[0]["EVALUATION_COUNT"].ToString() + "');");
                    this.ExecJScript("$('#spnMonthVol2').html('" + ds.Tables[0].Rows[0]["MONTHLY_VOLUME"].ToString() + "');");

                    //string strtem1 = decimal.Round((decimal)ds.Tables[0].Rows[0]["EVALUATION_AVG"], 1).ToString();
                    //this.ExecJScript("$('#spnRateDesc').html('<span class=\"c-value-no c-value-" + strtem1.Replace(".", "d") + "\"><em>" + strtem1 + "</em></span>" + strtem1 + "');");
                    //loadHeader(ds.Tables[0].Rows[0]["COMM_TENANT_ID"].ToString());
                }

                strTotalQty = drGoods["GOODS_QTY"].ToString();

                if (dsNorms == null)
                {
                    using (msBsc.AppLogic.DataAlc.CBizShpGoodsNormsPublic oCDbAccess2 = new msBsc.AppLogic.DataAlc.CBizShpGoodsNormsPublic())
                    {
                        dsNorms = oCDbAccess2.SelectByGoodsId(strGoodsId);
                    }
                }
                int itm222 = 0;
                for (int r = 0; r < dsNorms.Tables[0].Rows.Count; r++)
                {
                    itm222 += (int)dsNorms.Tables[0].Rows[r]["GOODS_QTY"];
                }
                strTotalQty = itm222.ToString();

                System.Transactions.TransactionOptions transactionOption = new System.Transactions.TransactionOptions();
                transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted;
                transactionOption.Timeout = new TimeSpan(0, 10, 0);
                using (System.Transactions.TransactionScope ts = new System.Transactions.TransactionScope(System.Transactions.TransactionScopeOption.Required, transactionOption))
                {
                    oCDbAccess.DataObj.ExecuteBySQL("UPDATE SHP_GOODS_INFO SET VIEW_NUM=ISNULL(VIEW_NUM,0)+1 WHERE GOODS_ID='" + strId + "'");
                    ts.Complete();
                }
            }
        }


        public void GetLogisticsFreight(string strLogisId, string strProvId, string strLogisNme, string strDealerId, string strQty)
        {
            using (Epm.AppLogic.Framework.CDbAccess oCDbAccess = new Epm.AppLogic.Framework.CDbAccess())
            {
                int iSelQty = int.Parse(strQty == string.Empty ? "0" : strQty);
                int iFirstQty = 0;
                int iAddQty = 0;
                decimal decFirstPrice = 0M;
                decimal decAddPrice = 0M;
                decimal decPrice = 0M;


                if (strProvId == string.Empty)
                {
                    string strClientIp = msBsc.SvRef.IpGet.GetClientIpInt().ToString();
                    DataSet ds1 = oCDbAccess.QueryBySQL("SELECT TOP 1 PROVINCE_ID,PROVINCE_NME FROM BSE_IP_TO_CITY WHERE START_IP <=" + strClientIp + " AND END_IP >= " + strClientIp);
                    if (ds1.Tables[0].Rows.Count > 0)
                    {
                        strProvId = ds1.Tables[0].Rows[0]["PROVINCE_ID"].ToString();
                        this.ExecJScript("LS.set('CURR_RECEIPT_PROVINCE_ID','" + strProvId + "')");
                        this.ExecJScript("LS.set('CURR_RECEIPT_PROVINCE_NME','" + ds1.Tables[0].Rows[0]["PROVINCE_NME"].ToString() + "')");
                        this.ExecJScript("$('#spnToProvince').html('" + ds1.Tables[0].Rows[0]["PROVINCE_NME"].ToString() + "'+'<i class=\"mui_addr_icon\">');");
                    }
                    else
                    {
                        strClientIp = msBsc.SvRef.IpSearch.GetAddressWithIP(msBsc.SvRef.IpGet.GetClientIp());
                        ds1 = oCDbAccess.QueryBySQL("SELECT TOP 1 * FROM BSE_PROVINCE WHERE PROVINCE_NME LIKE '%" + strClientIp.TrimStart().Split(' ')[0] + "%'");
                        if (ds1.Tables[0].Rows.Count > 0)
                        {
                            strProvId = ds1.Tables[0].Rows[0]["PROVINCE_ID"].ToString();
                            this.ExecJScript("LS.set('CURR_RECEIPT_PROVINCE_ID','" + strProvId + "')");
                            this.ExecJScript("LS.set('CURR_RECEIPT_PROVINCE_NME','" + ds1.Tables[0].Rows[0]["PROVINCE_NME"].ToString() + "')");
                            this.ExecJScript("$('#spnToProvince').html('" + ds1.Tables[0].Rows[0]["PROVINCE_NME"].ToString() + "'+'<i class=\"mui_addr_icon\">');");
                        }
                    }
                }
                if (strProvId == string.Empty)
                {
                    strProvId = "0";
                }




                if (!string.IsNullOrEmpty(strLogisId))
                {
                    DataSet ds = oCDbAccess.QueryBySQL("SELECT TOP 1 QTY_FIRST,PRICE_FIRST,QTY_ADD,PRICE_ADD FROM SHP_COMMERCIAL_LOGISTICS_ZONE WHERE LOGISTICS_TEMPLATE_ID='" + strLogisId + "'   ORDER BY (CASE WHEN PROVINCE_ID='" + strProvId + "' THEN 1 ELSE 0 END) DESC");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        iFirstQty = (int)ds.Tables[0].Rows[0]["QTY_FIRST"];
                        iAddQty = (int)ds.Tables[0].Rows[0]["QTY_ADD"];
                        decFirstPrice = (decimal)ds.Tables[0].Rows[0]["PRICE_FIRST"];
                        decAddPrice = (decimal)ds.Tables[0].Rows[0]["PRICE_ADD"];
                    }
                }

                 
                if (iSelQty > iFirstQty && iAddQty > 0 && decAddPrice > 0)
                {
                    decPrice = decFirstPrice + (decAddPrice * ((iSelQty - iFirstQty) / iAddQty) + 1);
                }
                else
                {
                    decPrice = decFirstPrice;
                }
                this.ExecJScript("$('#spnLogisticsFreight').html('" + decimal.Round(decPrice, 2).ToString() + "');");
                this.ExecJScript("$('#J_RSPostageCont').show();");
                this.ExecJScript("$('#J_RSPostageCont').next().hide();");
            }
        }

        private void doupdateqtyprice(string strLogisId, string strGid, string strSelP1, string strSelP2, string strQty)
        {
            using (msBsc.AppLogic.DataAlc.CBizShpGoodsNormsPublic objnorms = new AppLogic.DataAlc.CBizShpGoodsNormsPublic())
            {
                int iSelQty = int.Parse(strQty == string.Empty ? "0" : strQty);
                 
                DataSet ds = objnorms.DataObj.QueryBySQL("SELECT * FROM SHP_GOODS_NORMS_PUBLIC A WHERE A.GOODS_ID='" + strGid + "'  ");
                bool blHasSel = false;
                bool blHasP1 = false;
                bool blHasP2 = false;
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    if (ds.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() != string.Empty)
                    {
                        blHasP1 = true;
                    }
                    if (ds.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() != string.Empty)
                    {
                        blHasP2 = true;
                    }
                    if (ds.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() == strSelP1
                        && ds.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() == strSelP2)
                    {
                        this.ExecJScript("$('#spnStrikePrice').html('" + ds.Tables[0].Rows[i]["GOODS_STRIKE_PRICE"].ToString() + "');");
                        this.ExecJScript("$('#spnOldPrice').html('" + ds.Tables[0].Rows[i]["GOODS_OLD_PRICE"].ToString() + "');");
                        this.ExecJScript("$('#J_EmStock').html('" + ds.Tables[0].Rows[i]["GOODS_QTY"].ToString() + "');");
                        if (iSelQty > (int)ds.Tables[0].Rows[i]["GOODS_QTY"])
                        {
                            this.ExecJScript("$('#J_Amount input').val('" + ds.Tables[0].Rows[i]["GOODS_QTY"].ToString() + "');");
                        }
                        blHasSel = true;
                    }
                } 
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    //有P1无P2时锁定
                    if (blHasP1 && !blHasP2)
                    {
                        if ((int)ds.Tables[0].Rows[i]["GOODS_QTY"] <= 0)
                        {
                            this.ExecJScript("setnormslist('1','" + ds.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() + "',true);");
                        }
                    }
                    else if (blHasP2 && !blHasP1)
                    {
                        if ((int)ds.Tables[0].Rows[i]["GOODS_QTY"] <= 0)
                        {
                            this.ExecJScript("setnormslist('2','" + ds.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() + "',true);");
                        }
                    }
                    else
                    {
                        if (strSelP1 != string.Empty && strSelP2 == string.Empty)
                        {
                            if (i == 0)
                            {
                                this.ExecJScript("$('#J_TSaleProp_p2 li').removeClass('tb-out-of-stock').addClass('tb-out-of-stock');");
                            }

                            if (ds.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() == strSelP1 && (int)ds.Tables[0].Rows[i]["GOODS_QTY"] > 0)
                            {
                                this.ExecJScript("setnormslist('2','" + ds.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() + "',false);");
                            }
                        }
                        else if (strSelP2 != string.Empty && strSelP1 == string.Empty)
                        {
                            if (i == 0)
                            {
                                this.ExecJScript("$('#J_TSaleProp_p1 li').removeClass('tb-out-of-stock').addClass('tb-out-of-stock');");
                            }

                            if (ds.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() == strSelP2 && (int)ds.Tables[0].Rows[i]["GOODS_QTY"] > 0)
                            {
                                this.ExecJScript("setnormslist('1','" + ds.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() + "',false);");
                            }
                        }
                        else
                        {
                            if (i == 0)
                            {
                                this.ExecJScript("$('#J_TSaleProp_p1 li').removeClass('tb-out-of-stock').addClass('tb-out-of-stock');");
                                this.ExecJScript("$('#J_TSaleProp_p2 li').removeClass('tb-out-of-stock').addClass('tb-out-of-stock');");
                            }
                            if (ds.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() == strSelP1 && (int)ds.Tables[0].Rows[i]["GOODS_QTY"] > 0)
                            {
                                this.ExecJScript("setnormslist('2','" + ds.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() + "',false);");
                            }
                            if (ds.Tables[0].Rows[i]["PUB_NORMS_NME2"].ToString() == strSelP2 && (int)ds.Tables[0].Rows[i]["GOODS_QTY"] > 0)
                            {
                                this.ExecJScript("setnormslist('1','" + ds.Tables[0].Rows[i]["PUB_NORMS_NME1"].ToString() + "',false);");
                            }
                        }

                    }


                } 


            }
             
        }
        public override void DoAction()
        {
            if (this.strAction == "getAll")
            {
                GetLogisticsFreight(this.GetParamHtValue("LOGIS_ID"), this.GetParamHtValue("TO_PROV_ID"), this.GetParamHtValue("LOGIS_NME"), this.GetParamHtValue("DEALER_ID"), this.GetParamHtValue("SEL_QTY"));
                ////GetStaticInfo(this.GetParamHtValue("ID"));
                //doShowRecommendList(this.GetParamHtValue("ID"));

            }
            else if (this.strAction == "doupdateqtyprice")
            {
                doupdateqtyprice(this.GetParamHtValue("LOGIS_ID"), this.GetParamHtValue("ID"), this.GetParamHtValue("SEL_p1"), this.GetParamHtValue("SEL_p2"), this.GetParamHtValue("SEL_QTY"));
            }
            else if (this.strAction == "doFinderRateList")
            {
                //doShowRateGrid(this.GetParamHtValue("ID")
                //    , this.GetParamHtValue("FINDER_TYPE")
                //    , this.GetParamHtValue("HAS_CONTENT")
                //    , this.GetParamHtValue("NEW_PAGE_NUM")
                //    , this.GetParamHtValue("PAGE_ROW_COUNT")
                //    , this.GetParamHtValue("PAGE_ROW_SORT"));
            }
            else if (this.strAction == "doFinderBuyerList")
            {
                //doShowDealRecordGrid(this.GetParamHtValue("ID")
                //    , this.GetParamHtValue("NEW_PAGE_NUM")
                //    , this.GetParamHtValue("PAGE_ROW_COUNT")
                //    , this.GetParamHtValue("PAGE_ROW_SORT"));
            }
        }

    }
}